home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 4.0 KB | 153 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWMaping.cpp
- // Release Version: $ ODF 2 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #include "FWOS.hpp"
-
- #if defined(FW_PROFILER_CALLS) && defined(__MWERKS__)
- #pragma profile on
- #endif
-
- #ifndef FWMAPING_H
- #include "FWMaping.h"
- #endif
-
- #ifndef FWGRUTIL_H
- #include "FWGrUtil.h"
- #endif
-
- #ifndef SLGRGLOB_H
- #include "SLGrGlob.h"
- #endif
-
- #ifndef FWODMISC_H
- #include "FWODMisc.h"
- #endif
-
- #ifndef FWGRUTIL_H
- #include "FWGrUtil.h"
- #endif
-
- #ifndef SLREGION_H
- #include "SLRegion.h"
- #endif
-
- #ifndef FWSOMENV_H
- #include "FWSOMEnv.h"
- #endif
-
- // ----- OpenDoc Includes -----
-
- #ifndef SOM_ODTransform_xh
- #include <Trnsform.xh>
- #endif
-
- #ifndef SOM_ODShape_xh
- #include <Shape.xh>
- #endif
-
- //========================================================================================
- // RunTime Info
- //========================================================================================
-
- #ifdef FW_BUILD_MAC
- #pragma segment FWGraphics_Mapping
- #endif
-
- //========================================================================================
- // class FW_CMapping
- //========================================================================================
-
- FW_DEFINE_AUTO(FW_CMapping)
-
- //----------------------------------------------------------------------------------------
- // FW_CMapping::FW_CMapping
- //----------------------------------------------------------------------------------------
-
- FW_CMapping::FW_CMapping(FW_EMappingModes mappingMode)
- {
- FW_PrivMapping_Init(*this, mappingMode);
- FW_END_CONSTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMapping::FW_CMapping
- //----------------------------------------------------------------------------------------
-
- FW_CMapping::FW_CMapping(const FW_CMapping& mapping)
- {
- FW_PrivMapping_InitFromCopy(*this, mapping);
- FW_END_CONSTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMapping::FW_CMapping
- //----------------------------------------------------------------------------------------
-
- FW_CMapping::FW_CMapping(const FW_SMapping& sMapping)
- {
- FW_PrivMapping_InitFromCopy(*this, sMapping);
- FW_END_CONSTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMapping::~FW_CMapping
- //----------------------------------------------------------------------------------------
-
- FW_CMapping::~FW_CMapping()
- {
- FW_START_DESTRUCTOR
- FW_SOMEnvironment ev;
- FW_PrivMapping_Term(*this, ev);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMapping::operator=
- //----------------------------------------------------------------------------------------
-
- FW_CMapping& FW_CMapping::operator=(const FW_CMapping& mapping)
- {
- if (&mapping != this)
- {
- FW_SOMEnvironment ev;
- FW_PrivMapping_Term(*this, ev);
- FW_PrivMapping_InitFromCopy(*this, mapping);
- }
-
- return *this;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMapping::operator=
- //----------------------------------------------------------------------------------------
-
- FW_CMapping& FW_CMapping::operator=(const FW_SMapping& sMapping)
- {
- if (&sMapping != this)
- {
- FW_SOMEnvironment ev;
- FW_PrivMapping_Term(*this, ev);
- FW_PrivMapping_InitFromCopy(*this, sMapping);
- }
-
- return *this;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CMapping::operator==
- //----------------------------------------------------------------------------------------
-
- FW_Boolean FW_CMapping::operator==(const FW_CMapping& mapping) const
- {
- return (fMappingMode == mapping.fMappingMode &&
- fLogicalExtent == mapping.fLogicalExtent &&
- fDeviceExtent == mapping.fDeviceExtent &&
- fDeviceOrg == mapping.fDeviceOrg &&
- fLogicalOrg == mapping.fLogicalOrg);
- }
-